<?php 
$temp = 0;
foreach ($query->result() as $res):
		
	if($res->id_news!=""){
		if($temp=='#eee'){
	 		$bg='#ccc';
			$bgcount = '#FFEE79';
	 		$temp = 1;
	 	} else {
	 		$bg='#eee';
			$bgcount = '#FFFABB';
	 		$temp = 0;
		}
	}
		
				$q = $this->db->query("select username from member where id_member='$res->author' limit 1");
				foreach ($q->result() as $re):
						$res->author = $re->username;
				endforeach;
	
	if($res->images_type=="" || $res->images_type==NULL){
		$images = site_url("images/noimages.jpg");
	} else {
		$images = site_url(array('just4u','ImagesSmall','news',$res->id_news));
	}
	
	$res->description = word_limiter($res->description,40);
	
?>
<tr bgcolor="<?php echo $bg?>" align="left" class="draw" valign="top">
      <td class="marginContent"><b><?php echo $res->author ?></b></td>
      <td class="marginContent"><b><?php echo $res->name ?></b></td>
      <td class="marginContent"><img class="images" src="<?php echo $images ?>" /></td>
      <td class="marginContent"><?php echo $res->description ?></td>
      <td class="marginContent"><?php echo $res->posted ?></td>
      <td class="marginContent">
      	<a class="uiButtonRounded" href="<?php echo site_url(array('just4u','news_edit',$res->id_news))?>">Edit</a>
      	<a class="uiButtonRounded" href="javascript: delete_news('<?php echo $res->id_news?>')">Delete</a>
      </td>
</tr>
<?php 
endforeach;
?>
